#Phase 3 part of the code
Phase3Intro:
.asciiz "Congratulations, despite our best efforts you have successfully made it to phase 3.\nPhase 3 is the Integration portion of the class, where the verilog code from the entire class comes together and forms a working processor.\n\nBecause you have managed to reach phase 3 you have unlocked the prestige classes. You must now choose from one of 4 new prestige classes.\n1. Integration\n2. Demo\n3. Video\n4. Documentation" 

IntegrationIntro:
.asciiz "May God hath pitty on your soul, for you are now an Integration Overlord. Your job, should you choose to accept it, will be to take the crap code presented to you by the rest of the class and produce a working processor.\nIntelligence+20\nUnderstanding of MIPs+100\nLife-20\nGrade+20 (applies to entiire class)\nSleep-30"

IntegrationMonday:
.asciiz "\nIts Monday night,"

IntegrationWednesday:
.asciiz "\nIts Wednesday night,"

IntegrationThursday:
.asciiz "\nIts Thursday night," 

IntegrationFriday:
.asciiz "\nIts Friday night,"

IntegrationSaturday
.asciiz "\nIts Saturday night,"

IntegrationGen:
.asciiz " first week of Phase 3, what are you doing?\n1. Working in the Lab\n2. Working in the Lab\n3. Working in the Lab\n4. Working in the Lab"

IntegrationTuesday:
.asciiz "\nIts Tuesday night, first week of Phase 3, what are you doing?\n1. Working in the Lab\n2. Working in the Lab\n3. Working in the Lab\n4. Going home" 

false:
.asciiz "\nNo you're not, get back in the lab." 

yesterday:
.asciiz "\nYesterday...\nIt was Thursday...\nHowever, today it is:"

Friday:
.asciiz "\nFriday"

vidString1:
.asciiz "\n

phase3_start:

#Random Encounter
	jal combat_coinflip
	nop

	li $a0, phase3Intro
	jal libplp_uart_write_string
	nop

	# Integration
	move $t0, $v0
	li $t1, 0x00000031
	beq $t0, $t1, integration1
	nop
	# Demo
	move $t0, $v0
	li $t1, 0x00000032
	beq $t0, $t1, demo1
	nop
	#Video
	move $t0, $v0
	li $t1, 0x00000034
	beq $t0, $t1, vid1
	nop
	# Documentation
	move $t0, $v0
	li $t1, 0x00000035
	beq $t0, $t1, document1
	nop
	
integration1:

	#Random Event
	jal combat_coinflip
	nop
	
	li $a0, integrationIntro
	jal libplp_uart_write_string
	nop
	li $a0, IntegrationMonday
	jal libplp_uart_write_string
	nop
	li $a0, IntegrationGen
	jal libplp_uart_write_string
	nop
		
	move $t0, $v0
	li $t1, 0x00000031
	beq $t0, $t1, integration2
	nop
	move $t0, $v0
	li $t1, 0x00000032
	beq $t0, $t1, integration2
	nop
	move $t0, $v0
	li $t1, 0x00000034
	beq $t0, $t1, integration2
	nop
	move $t0, $v0
	li $t1, 0x00000035
	beq $t0, $t1, integration2
	nop
	
integration2:

	#Random Event
	jal combat_coinflip
	nop
	
	li $a0, IntegrationTuesday
	jal libplp_uart_write_string
	nop
	
	move $t0, $v0
	li $t1, 0x00000031
	beq $t0, $t1, integration3
	nop
	move $t0, $v0
	li $t1, 0x00000032
	beq $t0, $t1, integration3
	nop
	move $t0, $v0
	li $t1, 0x00000034
	beq $t0, $t1, integration3
	nop
	move $t0, $v0
	li $t1, 0x00000035
	beq $t0, $t1, integration3a
	nop
	
integration3a:
	li $a0, false
	jal libplp_uart_write_string
	nop
	j integration3
	nop
	
integration3

	#Random Event
	jal combat_coinflip
	nop

	li $a0, IntegrtionWednesday
	jal libplp_uart_write_string
	nop
	li $a0, IntegrationGen
	jal libplp_uart_write_string
	nop
		move $t0, $v0
	li $t1, 0x00000031
	beq $t0, $t1, integration4
	nop
	move $t0, $v0
	li $t1, 0x00000032
	beq $t0, $t1, integration4
	nop
	move $t0, $v0
	li $t1, 0x00000034
	beq $t0, $t1, integration4
	nop
	move $t0, $v0
	li $t1, 0x00000035
	beq $t0, $t1, integration4
	nop
	
integration4:

	#Random Event
	jal combat_coinflip
	nop

	li $a0, IntegrtionThursday
	jal libplp_uart_write_string
	nop
	li $a0, IntegrationGen
	jal libplp_uart_write_string
	nop
		move $t0, $v0
	li $t1, 0x00000031
	beq $t0, $t1, integration5
	nop
	move $t0, $v0
	li $t1, 0x00000032
	beq $t0, $t1, integration5
	nop
	move $t0, $v0
	li $t1, 0x00000034
	beq $t0, $t1, integration5
	nop
	move $t0, $v0
	li $t1, 0x00000035
	beq $t0, $t1, integration5
	nop	

integration5:

	#Random Event
	jal combat_coinflip
	nop

	li $a0, IntegrtionFridayday
	jal libplp_uart_write_string
	nop
	li $a0, IntegrationGen
	jal libplp_uart_write_string
	nop
		move $t0, $v0
	li $t1, 0x00000031
	beq $t0, $t1, integration6
	nop
	move $t0, $v0
	li $t1, 0x00000032
	beq $t0, $t1, integration6
	nop
	move $t0, $v0
	li $t1, 0x00000034
	beq $t0, $t1, integration6
	nop
	move $t0, $v0
	li $t1, 0x00000035
	beq $t0, $t1, integration6
	nop

integration6:

	#Random Event
	jal combat_coinflip
	nop

	li $a0, IntegrtionSaturday
	jal libplp_uart_write_string
	nop
	li $a0, IntegrationGen
	jal libplp_uart_write_string
	nop
		move $t0, $v0
	li $t1, 0x00000031
	beq $t0, $t1, integration4
	nop
	move $t0, $v0
	li $t1, 0x00000032
	beq $t0, $t1, integration4
	nop
	move $t0, $v0
	li $t1, 0x00000034
	beq $t0, $t1, integration4
	nop
	move $t0, $v0
	li $t1, 0x00000035
	beq $t0, $t1, integration4
	nop
	
vid1:
	
	#Random Event
	jal combat_coinflip
	nop
	
	li $a0, yesterday
	jal libplp_uart_write_string
	nop
	
Friday:
	li $a0, friday
	li $t1, 0x00000064
	li $t0, 0x00000000
	jal libplp_uart_write_string
	nop
	beq vidQuestion1
	addi $t0, $t0, 0x00000001
	bne Friday
	nop
	
vidQuestion1:
	
	#Random Event
	jal combat_coinflip
	nop
	
	li $a0, vidString1
	jal libplp_uart_write_string
	nop
	